package com.kitty.game.gm.handler;

import com.kitty.common.utils.SpringUtils;
import com.kitty.game.notice.model.Notice;
import com.kitty.game.role.model.Role;
import org.nutz.dao.Cnd;
import org.nutz.dao.Dao;

public class GmNotice implements GMFather {

    @Override
    public boolean handle(Role aaaaa, String content) {
        Dao dao = SpringUtils.getBean(Dao.class);
        Notice notice = dao.fetch(Notice.class, Cnd.where("id", "=", 1));
        if (notice == null) {
            notice = new Notice();
        }
        notice.setContent(content);
        dao.insertOrUpdate(notice);
        return true;
    }
}
